Skip to main content Skip to complementary content

patch_task

Use the methods described in this topic to get and modify settings of existing tasks.

Required user role

See Required Enterprise Manager permissions.

Payload overview

The payload should be in JSON format and determines:

  • Setting values that will be changed

  • Settings that will be disabled

As the API reflects the behavior and functionality of the Replicate UI, some settings require certain parent settings to be enabled before they can be modified. For example, it is not possible to enable the Optimize handling when LOB size is less than option when the Replicate LOB columns option is disabled. Therefore, if you are not sure whether the parent settings are enabled, to prevent errors, best practice is to include operations for enabling the parent settings in the request payload as well. Examples of how to do this are provided below.

Information noteTo verify a command in the Replicate console, you must first refresh your browser.

Changing a setting value

Syntax

The syntax for changing a setting value is as follows:

[
	{ "op": "add", "path": "full path to setting", "value": new-value }
]

Example

The following example shows how to change the Maximum number of tables setting in the Full Load Tuning tab.

[
	{ "op": "add", "path": "/full_load_sub_tasks", "value": 100 }
]

Reverting to the default setting value

You revert a setting to its default value by using the "remove" command. If the setting is dependent on other settings being enabled, you also need to enable those settings before you can revert the specific setting to its default. If you are aware that the related settings are already enabled, then you can simply use the "remove" operation.

Example

In the following example, the user wants to revert the Chunk size (KB) (lob_chunk_size) setting to its default value. Changing this setting or restoring its default requires the Replicate LOB columns and Allow unlimited LOB size settings to be enabled. Because the user is not sure they are enabled, he includes operations for enabling them in the request payload.

[
	{ "op": "add", "path": "/common_settings/support_lobs", "value": true },
	{ "op": "add", "path": "/common_settings/lob_max_size", "value": 0 },
	{ "op": "remove", "path": "/common_settings/lob_chunk_size" }
]

If the user knew beforehand that the Replicate LOB columns and Allow unlimited LOB size settings were enabled, he would only need to include the "remove" operation in the request payload.

[
	{ "op": "remove", "path": "/common_settings/lob_chunk_size" }
]

Enabling or disabling a setting (the equivalent of selecting or clearing a check box)

You enable a setting using the "add" operation. You can disable a setting using the "remove" operation or by setting the value to "false".

Enabling a setting

The syntax for enabling a setting is as follows:

[
	{ "op": "add", "path": "path_to_setting", "value": true }
]

To enable the Replicate LOB columns option:

[
	{ "op": "add", "path": "/common_settings/support_lobs", "value": true }
]

Disabling a setting using the "remove" operation

The syntax for disabling a setting using the "remove" operation is as follows:

[
	{ "op": "remove", "path": "path_to_setting" }
]

To disable the Replicate LOB columns option:

[
	{ "op": "remove", "path": "/common_settings/support_lobs" }
]

Disabling a setting by setting its value to "false"

The syntax for disabling a setting by setting its value to "false" is as follows:

[
	{ "op": "add", "path": "path_to_setting", "value": false }
]

To disable the Replicate LOB columns option:

[
	{ "op": "add", "path": "/common_settings/support_lobs", "value": false }
]

 

Configuring task settings

Call patch_task_settings to modify all supported task settings, except the task description.

Syntax

def patch_task_settings(self, payload, server, task)

Parameters

Parameters
Parameter Type Description
payload AemTaskProperties

A JSON payload containing the settings to modify.

server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Payloads for supported settings

Example

settings = json.dumps([{"op": "add", "path": "/common_settings/support_lobs", "value": True}])
example_program.aem_client.patch_task_settings(settings, 'MyServerName', 'MyTaskName')

Setting or removing the task description

Call put_task_properties to set or remove the task description.

Syntax

def put_task_properties(payload, self, server, task)

Parameters

Parameters
Parameter Type Description
payload string

The payload as shown below.

server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Payload

Action Payload with examples
Add a valid description

Add a description (Uppercase/Lowercase/Numbers/Space/Special Characters)

{
  "description": "important task"
}
Remove description

Remove the description

{
  "description": ""
}

Example

description = AemTaskProperties({"description": "important task"})
example_program.aem_client.put_task_properties(description, 'MyServerName', 'MyTaskName')

Configuring error handling

Call put_task_error_behavior to modify the error handling settings.

Syntax

def put_task_error_behavior(self, payload, server, task)

Parameters

Parameters
Parameter Type Description
payload string

The JSON payload consisting of the error handling settings to change.

server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Payload

Warning noteDue to a known limitation, you always need to include all of the current error handling settings in the payload, even if you only want to modify only a single setting.
Action Payload with examples
Environmental errors

Change the "Maximum retry count" value:

{
  "error_behavior": {
    "recoverable_error_behavior": {
      "count": 2
    }
  }
}

 

Restore the default "Maximum retry count"

{
  "error_behavior": {
    "recoverable_error_behavior": {
      "count": -1
    }
  }
}

 

Disable the "Maximum retry count" option

{
  "error_behavior": {
    "recoverable_error_behavior": {
      "count": 0
    }
  }
}

 

Enable the "Increase retry interval for long outages" option

{
  "error_behavior": {
    "recoverable_error_behavior": {
      "throttling": true
    }
  }
}

 

Disable the "Increase retry interval for long outages" option

{
  "error_behavior": {
    "recoverable_error_behavior": {
      "throttling": false
    }
  }
}

 

Change the "Maximum retry interval (seconds)" value

{
  "error_behavior": {
    "recoverable_error_behavior": {
      "throttling_max": 2000
    }
  }
}
Data errors: For data truncation errors

Set "For data truncation errors: Ignore record"

{
  "error_behavior": {
    "data_error_behavior": {
      "truncation_policy": "ERROR_POLICY_IGNORE_RECORD"
    }
  }
}

Set "For data truncation errors: Suspend table"

{
  "error_behavior": {
    "data_error_behavior": {
      "truncation_policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Set "For data truncation errors: Stop Task"

{
  "error_behavior": {
    "data_error_behavior": {
      "truncation_policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "For data truncation errors: Log record to the exceptions table"

{
  "error_behavior": {
    "data_error_behavior": {
      "truncation_policy": "ERROR_POLICY_LOG_ERROR"
    }
  }
}

Data errors: For NOT NULL constraint violations:

Enable "Check" option for "For NOT NULL constraint violations"

{
  "error_behavior": {
    "data_error_behavior": {
      "nullability_check_data_error": "YES"
    }
  }
}

Enable "Don't check" option for "For NOT NULL constraint violations"

{
  "error_behavior": {
    "data_error_behavior": {
      "nullability_check_data_error": "NO"
    }
  }
}

Enable "Endpoint-determined (Check)" option for "For NOT NULL constraint violations"

{
  "error_behavior": {
    "data_error_behavior": {
      "nullability_check_data_error": "ENDPOINT_DETERMINED"
    }
  }
}

Set "For NOT NULL constraint violations: Ignore record"

{
  "error_behavior": {
    "data_error_behavior": {
      "nullability_policy": "ERROR_POLICY_IGNORE_RECORD"
    }
  }
}

Set "For NOT NULL constraint violations: Suspend table"

{
  "error_behavior": {
    "data_error_behavior": {
      "nullability_policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Set "For NOT NULL constraint violations: Stop Task"

{
  "error_behavior": {
    "data_error_behavior": {
      "nullability_policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "For NOT NULL constraint violations: Log record to the exceptions table"

{
  "error_behavior": {
    "data_error_behavior": {
      "nullability_policy": "ERROR_POLICY_LOG_ERROR"
    }
  }
}
Data errors: For other data errors

Set "For data truncation errors: Ignore record"

{
  "error_behavior": {
    "data_error_behavior": {
      "policy": "ERROR_POLICY_IGNORE_RECORD"
    }
  }
}

Set "For data truncation errors: Suspend table"

{
  "error_behavior": {
    "data_error_behavior": {
      "policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Set "For data truncation errors: Stop Task"

{
  "error_behavior": {
    "data_error_behavior": {
      "policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "For data truncation errors: Log record to the exceptions table"

{
  "error_behavior": {
    "data_error_behavior": {
      "policy": "ERROR_POLICY_LOG_ERROR"
    }
  }
}

Enable "Escalate handling when data errors reach (per table)" checkbox

{
  "error_behavior": {
    "data_error_behavior": {
      "escalation_count": 50
    }
  }
}

Disable "Escalate handling when data errors reach (per table)" checkbox

{
  "error_behavior": {
    "data_error_behavior": {
      "escalation_count": 0
    }
  }
}

Set "Escalation action: Stop Task" for data errors

{
  "error_behavior": {
    "data_error_behavior": {
      "escalation_count": 50,
      "escalation_policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "Escalation action: Suspend table" for data errors

{
  "error_behavior": {
    "data_error_behavior": {
      "escalation_count": 50,
      "escalation_policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Table Errors

Set "When encountering a table error: Stop Task"

{
  "error_behavior": {
    "table_error_behavior": {
      "policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "When encountering a table error: Suspend table"

{
  "error_behavior": {
    "table_error_behavior": {
      "policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Enable "Escalate handling when data errors reach (per table)" checkbox

{
  "error_behavior": {
    "table_error_behavior": {
      "escalation_count": 50
    }
  }
}

Disable "Escalate handling when data errors reach (per table)"checkbox

{
  "error_behavior": {
    "table_error_behavior": {
      "escalation_count": 0
    }
  }
}
Apply conflict: No record found for applying DELETE

Set "No record found for applying DELETE: Ignore record"

{
  "error_behavior": {
    "apply_error_behavior": {
      "delete_policy": "ERROR_POLICY_IGNORE_RECORD"
    }
  }
}

Set "No record found for applying DELETE: Suspend table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "delete_policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Set "No record found for applying DELETE: Stop Task"

{
  "error_behavior": {
    "apply_error_behavior": {
      "delete_policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "No record found for applying DELETE: Log record to the exceptions table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "delete_policy": "ERROR_POLICY_LOG_ERROR"
    }
  }
}
Apply conflict: Duplicate key when applying INSERT

Set "Duplicate key when applying INSERT: Ignore record" of Apply Conflict

{
  "error_behavior": {
    "apply_error_behavior": {
      "insert_policy": "ERROR_POLICY_IGNORE_RECORD"
    }
  }
}

Set "Duplicate key when applying INSERT: Suspend table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "insert_policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Set "Duplicate key when applying INSERT: Stop Task"

{
  "error_behavior": {
    "apply_error_behavior": {
      "insert_policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "Duplicate key when applying INSERT: Log record to the exceptions table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "insert_policy": "ERROR_POLICY_LOG_ERROR"
    }
  }
}

Set "Duplicate key when applying INSERT: UPDATE the existing target record"

{
  "error_behavior": {
    "apply_error_behavior": {
      "insert_policy": "ERROR_POLICY_MERGE_MODE"
    }
  }
}
Apply conflict: No record found for applying an UPDATE

Set "No record found for applying an UPDATE: Ignore record"

{
  "error_behavior": {
    "apply_error_behavior": {
      "update_policy": "ERROR_POLICY_IGNORE_RECORD"
    }
  }
}

Set "No record found for applying an UPDATE: Suspend table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "update_policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Set "No record found for applying an UPDATE: Stop Task"

{
  "error_behavior": {
    "apply_error_behavior": {
      "update_policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "No record found for applying an UPDATE: Log record to the exceptions table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "update_policy": "ERROR_POLICY_LOG_ERROR"
    }
  }
}

Set "No record found for applying an UPDATE: INSERT the missing target record"

{
  "error_behavior": {
    "apply_error_behavior": {
      "update_policy": "ERROR_POLICY_UPSERT_MODE"
    }
  }
}
Apply conflict: Escalate handling when data errors reach (per table)

Enable "Escalate handling when data errors reach (per table)" checkbox

{
  "error_behavior": {
    "apply_error_behavior": {
      "escalation_count": 50
    }
  }
}

Disable "Escalate handling when data errors reach (per table)" checkbox

{
  "error_behavior": {
    "apply_error_behavior": {
      "escalation_count": 0
    }
  }
}

Set "Escalation action: Stop Task"

{
  "error_behavior": {
    "apply_error_behavior": {
      "escalation_count": 50,
      "escalation_policy": "ERROR_POLICY_STOP_TASK"
    }
  }
}

Set "Escalation action: Suspend table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "escalation_count": 50,
      "escalation_policy": "ERROR_POLICY_SUSPEND_TABLE"
    }
  }
}

Set "Escalation action: Log record to the exceptions table"

{
  "error_behavior": {
    "apply_error_behavior": {
      "escalation_count": 50,
      "escalation_policy": "ERROR_POLICY_LOG_ERROR"
    }
  }
}

Example

example_program = ExamplePythonProgram()
    task_error_handling = {
        "error_behavior": {
            "apply_error_behavior": {
                "delete_policy": "ERROR_POLICY_LOG_ERROR",
                "insert_policy": "ERROR_POLICY_LOG_ERROR",
                "update_policy": "ERROR_POLICY_LOG_ERROR",
                "escalation_count": 0,
                "escalation_policy": "ERROR_POLICY_SUSPEND_TABLE",
                "full_load_ignore_conflicts": True
            },
            "table_error_behavior": {
                "policy": "ERROR_POLICY_SUSPEND_TABLE",
                "escalation_count": 0,
                "escalation_policy": "ERROR_POLICY_STOP_TASK"
            },
            "data_error_behavior": {
                "policy": "ERROR_POLICY_LOG_ERROR",
                "escalation_count": 0,
                "escalation_policy": "ERROR_POLICY_SUSPEND_TABLE",
                "truncation_policy": "ERROR_POLICY_LOG_ERROR",
                "nullability_policy": "ERROR_POLICY_SUSPEND_TABLE",
                "nullability_check_data_error": "ENDPOINT_DETERMINED"
            },
            "recoverable_error_behavior": {
                "count": -1,
                "interval": 5,
                "throttling": True,
                "throttling_max": 1800,
                "abnormal_count": 5,
                "recovery_grace_period": 10,
                "max_table_repeated_fail_count": 3
            }
        }
    }
    settings_json_string = json.dumps(task_error_handling)
    aem_task_error_behavior = AemTaskErrorBehavior(settings_json_string)
    example_program.aem_client.put_task_error_behavior(aem_task_error_behavior, "MyServerName", "MyTaskName")

Configuring logging

Call put_task_loggers to modify the logging settings.

Syntax

def put_task_loggers(payload, self, server, task)

 

Parameters

Parameters
Parameter Type Description
payload string

The JSON payload consisting of the logging settings to change.

server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Payload

Action Payload with examples
Changing the global logging level
{
 "loggers":[
  {
    "logger_type": "AT_GLOBAL",
    "log_level": "DEBUG"
  }
 ]
}
{
 "loggers":[
  {
    "logger_type": "AT_GLOBAL",
    "log_level": "DETAILED_DEBUG"
  }
 ]
}
{
 "loggers":[
  {
    "logger_type": "AT_GLOBAL",
    "log_level": "WARNING"
  }
 ]
}
{
 "loggers":[
  {
    "logger_type": "AT_GLOBAL",
    "log_level": "ERROR"
  }
 ]
}
Change the logging level of a specific component
{
 "loggers":[
  {
    "logger_type": "UTILITIES",
    "log_level": "DETAILED_DEBUG"
  }
 ]
}
Change the global logging level and the logging level of a specific component

{
  "loggers": [
   {
     "logger_type": "AT_GLOBAL",
     "log_level": "DETAILED_DEBUG"
   },
   {
     "logger_type": "STREAM",
     "log_level": "ERROR"
   }
 ]
}
Change multiple components to different logging levels

{
  "loggers": [
   {
     "logger_type": "ADDONS",
     "log_level": "DETAILED_DEBUG"
   },
   {
     "logger_type": "STREAM",
     "log_level": "ERROR"
   }
 ]
}
Store trace/verbose logging in memory, but if an error occurs write to the logs
{
	"trace_on_error":true 
}
{
	"trace_on_error":false
}
{
	"trace_on_error":true,
	"trace_on_error_size_mb":20
}

Example

task_loggers = AemTaskLoggers(json.dumps({"loggers":[{"logger_type": "AT_GLOBAL","log_level": "INFO"}]}))
example_program.aem_client.put_task_loggers(task_loggers, "denisrh8", "test_task")

Getting all settings, except Replicate loggers, the task description, and error handling

Call task_settings_patch_template to get current values for all settings, except Replicate loggers, the task description, and error handling settings.

Syntax

def task_settings_patch_template(self, payload, task)

Parameters

Parameters
Parameter Type Description
payload string

The JSON payload consisting of the settings.

Payload example:

Find out if LOB support is enabled, the maximum LOB size, and the target schema:

[
  { "path": "/common_settings/support_lobs" },
  { "path": "/target_settings/default_schema" },
  { "path": "/common_settings/lob_max_size" }
]
server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Example

setting = json.dumps([{"path": "/common_settings/support_lobs"}])
print(example_program.aem_client.task_settings_patch_template(setting, "MyServerName", "MyTaskName"))

Getting the task description

Call get_task_properties to get the current task description.

Syntax

def get_task_properties(self, server, task)

Parameters

Parameters
Parameter Type Description
server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Example

example_program = ExamplePythonProgram()
 task_properties = example_program.aem_client.get_task_properties("denisrh8", "test_task")
 print(json.dumps(AttUtil.attobject_to_json(task_properties), indent=3))

Getting the task error settings

Call get_task_eror_behavior to get the current task error settings.

Syntax

def get_task_eror_behavior(self, server, task)

Parameters

Parameters
Parameter Type Description
server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Example

example_program = ExamplePythonProgram() 
 error_behavior = example_program.aem_client.get_task_error_behavior("denisrh8", "test_task") 
 print(json.dumps(AttUtil.attobject_to_json(error_behavior), indent=3))

Getting the task logger settings

Call get_task_loggers to get the current task logger settings.

Syntax

def get_task_loggers(self, server, task)

Parameters

Parameters
Parameter Type Description
server string

The Replicate server name as defined in Enterprise Manager.

Example:

myrepsrv1

task string

The name of an existing task.

Example

example_program = ExamplePythonProgram()
 loggers = example_program.aem_client.get_task_loggers("denisrh8", "test_task")
 print(json.dumps(AttUtil.attobject_to_json(loggers), indent=3))

Errors

Apart from specific errors related to settings that are not valid, you might also encounter general errors. For more information on these, see general errors.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!